let a=1
function f(){
    console.log(a);
    // let a=2//写上这句报错
}
f()
//-----------------------------------------------------------------------
// fn2()
// var fn2=function(){//fn2 is not a function
//     console.log('fn2');
// }
fn2()
let fn2=function(){//Cannot access 'fn2' before initialization
    console.log('fn2');
}